Source: FEMA, NFIP Redacted Claims, last updated July 2020
cvilleAmountPaidByTract <- read_csv("../data/fema_nfip_cville_tract.csv")
meta <- read_sheet("https://docs.google.com/spreadsheets/d/1nqm3DuVXD1ObbVe_deacvT7uSLdBXfQJo3mkbqDwrVo/edit#gid=5733069", sheet = 'fema_nfip')
glimpse(cvilleAmountPaidByTract)
## Rows: 19
## Columns: 8
## $ censusTract <dbl> 51003010100, 51003010201, 51003010402, 51…
## $ n <dbl> 1, 1, 2, 2, 8, 4, 1, 1, 7, 9, 1, 1, 3, 1,…
## $ sumAmountPaidOnBuildingClaim <dbl> 5990.52, 4216.12, 0.00, 18406.49, 140550.…
## $ sumAmountPaidOnContentsClaim <dbl> 0.00, 0.00, 0.00, 0.00, 8158.53, 3029.18,…
## $ sumBuildingInsuranceCoverage <dbl> 250000, 250000, 500000, 450000, 1355000, …
## $ sumContentsInsuranceCoverage <dbl> 100000, 100000, 200000, 180000, 342000, 1…
## $ totalInsuranceCoverage <dbl> 350000, 350000, 700000, 630000, 1697000, …
## $ totalAmountPaid <dbl> 5990.52, 4216.12, 0.00, 18406.49, 148709.…
Variables of Interest: Number of flood claims in spatial unit & total amount paid on flood claims in spatial unit; goal: understanding the degree of damage experienced in a place
cvilleAmountPaidByTract %>% count(censusTract)
## # A tibble: 19 x 2
## censusTract n
## <dbl> <int>
## 1 51003010100 1
## 2 51003010201 1
## 3 51003010402 1
## 4 51003010500 1
## 5 51003011000 1
## 6 51003011202 1
## 7 51003011400 1
## 8 51065020102 1
## 9 51079030101 1
## 10 51079030102 1
## 11 51109950100 1
## 12 51109950400 1
## 13 51125950200 1
## 14 51125950300 1
## 15 51540000201 1
## 16 51540000302 1
## 17 51540000402 1
## 18 51540000502 1
## 19 51540000700 1
# 55 total observations
Variable Descriptions:
meta %>%
select(c(varname, about)) %>%
as.list()
## $varname
## [1] "censusTract" "n"
## [3] "sumAmountPaidOnBuildingClaim" "sumAmountPaidOnContentsClaim"
## [5] "sumBuildingInsuranceCoverage" "sumContentsInsuranceCoverage"
## [7] "totalInsuranceAmount" "totalAmountPaid"
##
## $about
## [1] "11-digit code defining census tract"
## [2] "# of observations in each tract"
## [3] "sum of $ amount paid on the building claims in each tract"
## [4] "sum of $ amount paid on the contents claims in each tract"
## [5] "sum of the total insurance amount in $ on the buildings (by tract)"
## [6] "sum of the total insurance amount in $ on the contents (by tract)"
## [7] "sum of the building and contents insurance coverage by tract"
## [8] "sum of the total amount paid on both building and contents claims by tract"
# barplot of the total $ amount paid by census tract
ggplot(cvilleAmountPaidByTract) +
geom_col(aes(x=as.factor(censusTract), y=totalAmountPaid)) +
coord_flip() +
labs(x="Census Tract",
y="$ Amount Paid",
title="Total Building & Contents Claim Amount Paid by Census Tract")
# barplot of the total insurance coverage amount by census tract
ggplot(cvilleAmountPaidByTract) +
geom_col(aes(x=as.factor(censusTract), y=totalInsuranceCoverage)) +
coord_flip() +
labs(x="Census Tract",
y="Insurance Coverage (in $)",
title="Insurance Coverage Amount by Census Tract")
pal <- colorNumeric("plasma", reverse = TRUE, domain = cville_amount$n) # viridis
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data = cville_amount,
fillColor = ~pal(n),
weight = 1,
opacity = 1,
color = "white",
fillOpacity = 0.6,
highlight = highlightOptions(
weight = 2,
fillOpacity = 0.8,
bringToFront = T
),
popup = paste0("Tract Number: ", cville_amount$NAME, "<br>",
"Number: ", round(cville_amount$n, 2))
) %>%
addLegend("bottomright", pal = pal, values = cville_amount$n,
title = "# FEMA Claims", opacity = 0.7)
pal <- colorNumeric("plasma", reverse = TRUE, domain = cville_amount$totalInsuranceCoverage) # viridis
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data = cville_amount,
fillColor = ~pal(totalInsuranceCoverage),
weight = 1,
opacity = 1,
color = "white",
fillOpacity = 0.6,
highlight = highlightOptions(
weight = 2,
fillOpacity = 0.8,
bringToFront = T
),
popup = paste0("Tract Number: ", cville_amount$NAME, "<br>",
"$ Amount: ", round(cville_amount$totalInsuranceCoverage, 2))
) %>%
addLegend("bottomright", pal = pal, values = cville_amount$totalInsuranceCoverage,
title = "Insurace Coverage Amount", opacity = 0.7)
pal <- colorNumeric("plasma", reverse = TRUE, domain = cville_amount$totalAmountPaid) # viridis
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data = cville_amount,
fillColor = ~pal(totalAmountPaid),
weight = 1,
opacity = 1,
color = "white",
fillOpacity = 0.6,
highlight = highlightOptions(
weight = 2,
fillOpacity = 0.8,
bringToFront = T
),
popup = paste0("Tract Number: ", cville_amount$NAME, "<br>",
"$ Amount: ", round(cville_amount$totalAmountPaid, 2))
) %>%
addLegend("bottomright", pal = pal, values = cville_amount$totalAmountPaid,
title = "Claim Amount Paid", opacity = 0.7)
This is a list of all of FEMA’s open data sets and could be helpful
claim manual that gives a little more details on how claims are filed (might not be that helpful though)
Other potential variables of interest (from original dataset): - elevatedBuildingIndicator: Yes (Y) or No (N) indicator of whether or not a building meets the NFIP definition of an elevated building (if it does not meet this criteria –> higher chance for flood damage) - floodZone: derived from the Flood Insurance Rate Map (FIRM) used to rate the insured property (ie. how susceptible to flood damage they are)